const express = require('express');
const router = express.Router();
const userController = require('../controllers/userController');
const { authenticate } = require('../middlewares/auth');

// 公开路由
router.post('/register', userController.register);
router.post('/login', userController.login);
router.post('/send-register-code', userController.sendRegisterCode);
router.post('/send-reset-password-code', userController.sendResetPasswordCode);
router.post('/reset-password', userController.resetPassword);

// 需要认证的路由
router.get('/me', authenticate, userController.getCurrentUser);

module.exports = router;